#!/usr/bin/env python
# coding: utf-8

# 编写一个函数，接受一个参数n，n为正整数，上下三角两种打印方式。要求数字必须对齐




def fn(n):
    tail = "  ".join((str(i) for i in range(n,0,-1)))
#     print(tail)
    width = len(tail)
    for i in range(1,n+1):
        print("{:>{}}".format("  ".join([str(j) for j in range(i,0,-1)]),width))
    print("-------------------------------------------")
    for i in range(n,0,-1):
        print("{:>{}}".format("  ".join([str(j) for j in range(i,0,-1)]),width))



# 做得不错
